#ifndef __RayTracerH__
#define __RayTracerH__

#include "scene_parser.h"
#include "image.h"

class RayTracer
{
public:
	RayTracer();
	~RayTracer();
	void setScene(const char *input_file);
	Vec3f traceRay(Ray *pRay, float t_min, float t_max, int bounces, float weight,
					float indexOfRefraction)const;
	bool render();
private:
	RayTracer(const RayTracer& rayTracer);
	RayTracer& operator=(const RayTracer& rayTracer);

	Vec3f getMirrorDir(const Vec3f L, const Vec3f N)const;
	bool getTransparentDir(const Vec3f &normal, const Vec3f &incoming,
		float index_i, float index_t, Vec3f &transDir )const;
private:
	SceneParser *m_pScenceParser;
	Image *m_pImage;
	const float WEIGHTDEDUCE;
	float m_t_min,m_t_max; 
	int m_max_bounces;
	float m_min_wight;
	int m_sampleNum;
	int m_width;
	int m_height;
};

#endif